package com.itsome.pojo;

import org.springframework.util.Assert;

/**
 * @author itsome on 2020-04-15
 */
public enum FssExcelTypeEnum {
    XLS(".xls"),
    XLSX(".xlsx"),
    XLSM(".xlsm");

    private String value;

    FssExcelTypeEnum(String value) {
        this.setValue(value);
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static boolean checkExcelType(String type) {
        Assert.notNull(type, "类型为空");
        for (FssExcelTypeEnum typeEnum : FssExcelTypeEnum.values()) {
            if (type.toLowerCase().endsWith(typeEnum.getValue())) {
                return true;
            }
        }
        return false;
    }
}
